package day_2022_12_to_3.year2023;

import java.util.*;

/**
 * @author haomin
 * @date 2023/01/20 14:18
 **/
public class Day1_20_Num1817 {
    class Solution {
        public int[] findingUsersActiveMinutes(int[][] logs, int k) {
            Map<Integer, HashSet<Integer>> map = new LinkedHashMap<>();
            for(int[] ret : logs) {
                Set<Integer> set = new HashSet<>();
                if(!map.containsKey(ret[0])) {
                    map.put(ret[0], new HashSet<Integer>());
                }
                map.get(ret[0]).add(ret[1]);
            }
            int[] res = new int[k];
            for (Map.Entry<Integer, HashSet<Integer>> e : map.entrySet()) {
                res[e.getValue().size() - 1] ++;
            }
            return res;
        }
    }
}